import { createRouter, createWebHashHistory } from 'vue-router'

const router = createRouter({
  //     路由模式 hash
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      component: () => import('../view/home/index.vue'),
      name: 'login',
    },
    {
      path: '/dashboard',
      component: () => import('../view/dashboard/index.vue'),
      name: 'dashboard',
    },
    {
      path: '/404',
      component: () => import('../view/404/index.vue'),
      name: '404',
    },
    {
      path: '/:pathMatch(.*)*',
      redirect: '/404',
    },
  ],
})

export default router
